package com.yj.ccs.abs.common.enums;

/**
 * Copyright 2018 (C) Yunjian-VC
 * Created on : 2018/3/16
 * Author     : Unbelievable9
 **/
public enum ShadowRatingType {

    /**
     * 1 - AAA
     * 2 - AA+
     * 3 - AA
     * 4 - AA-
     * 5 - A+
     * 6 - A
     * 7 - A-
     */
    THREE_A(1),
    TWO_A_PLUS(2),
    TWO_A(3),
    TWO_A_MINUS(4),
    ONE_A_PLUS(5),
    ONE_A(6),
    ONE_A_MINUS(7);

    private final Integer value;

    ShadowRatingType(Integer value) {
        this.value = value;
    }

    public Integer getValue() {
        return value;
    }

    public static ShadowRatingType fromValue(Integer value) {
        for (ShadowRatingType shadowRatingType : ShadowRatingType.values()) {
            if (shadowRatingType.getValue().equals(value)) {
                return shadowRatingType;
            }
        }

        return null;
    }
}
